<template>
  <div class="chat-header">
    <CommonHeader
      :showReset="showReset"
      @reset="onResetChat"
      :transferStatus="transferStatus"
      :transferAvatar="transferAvatar"
      @startCall="startCall"
      :isVoice="isVoice"
      @autoPlayChange="$emit('autoPlayChange', $event)"
      :autoPlay="autoPlay"
    />
  </div>
</template>

<script>
import CommonHeader from "./common-header";

export default {
  name: "ChatHeader",
  components: {
    CommonHeader,
  },
  props: {
    isWeclome: {
      type: Boolean,
      default: false,
    },
    isVoice: {
      type: Boolean,
      default: false,
    },
    showReset: {
      type: Boolean,
      default: true,
    },
    transferStatus: {
      type: Boolean,
      default: false,
    },
    transferAvatar: {
      type: String,
      default: "",
    },
    autoPlay: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {};
  },
  created() {},
  methods: {
    startCall() {
      console.log("startCall");
      this.$emit("startCall");
    },
    onResetChat(val) {
      if (val) {
        this.$emit("reset", val);
      } else {
        this.$emit("reset");
      }
    },
  },
};
</script>

<style lang="less">
.chat-header {
}
</style>